package park;

import java.util.Scanner;

public class J03Tax {

	public static void main(String[] args) {

		// 세금 계산프로그램
		// 조건1:미혼 - 연봉이 3000미만 = 5% 연봉이 3000이상 = 10%
		// 조건2:기혼 - 연봉이 5000미만 = 15% 연봉이 5000이상 = 30%

		// 입력값 : 결혼여부,연봉
		// 결과값 : 비율에 따른 세금

		int x = 0;
		int o = 0;
		int sal = 0;
		double tax = 0;
		double taxm = 0;
		double taxam = 0;
		Scanner sc = null;

		System.out.println("미혼이면 1번 , 기혼이면 2번 (숫자만 입력하세요)");

		sc = new Scanner(System.in);

		x = sc.nextInt();

		if (x == 1) {

			System.out.println("1번 미혼이시네요 ^^");

			System.out.println("다음은 연봉을 입력해주세요(숫자만)");

			sal = sc.nextInt();

			if (sal <= 3000) {

				tax = 0.05;
				taxm = sal * 0.05;
				taxam = sal - taxm;

				System.out.println("세율은" + tax + "입니다");
				System.out.println("세금은" + taxm + "입니다");
				System.out.println("세금 공제후 금액은" + taxam + "입니다");
				
			}

			else {

				tax = 0.1;
				taxm = sal * 0.1;
				taxam = sal - taxm;

				System.out.println("세율은" + tax + "입니다");
				System.out.println("세금은" + taxm + "입니다");
				System.out.println("세금 공제후 금액은" + taxam + "입니다");

			}

		}

			else {

				System.out.println("2번 기혼이시네요 ^^");
		
				System.out.println("다음은 연봉을 입력해주세요(숫자만)");
		
				sal = sc.nextInt();
		
				if (sal <= 5000) {
		
					tax = 0.15;
					taxm = sal * 0.15;
					taxam = sal - taxm;
		
					System.out.println("세율은" + tax + "입니다");
					System.out.println("세금은" + taxm + "입니다");
					System.out.println("세금 공제후 금액은" + taxam + "입니다");

			}

			else {
	
					tax = 0.3;
					taxm = sal * 0.3;
					taxam = sal - taxm;
	
					System.out.println("세율은" + tax + "입니다");
					System.out.println("세금은" + taxm + "입니다");
					System.out.println("세금 공제후 금액은" + taxam + "입니다");

			}

		}

		sc.close();

	}

}
